#!/bin/sh

if [ "$(curl https://big.oisd.nl/domainswild -I | grep -E '^Content-Type' -i | cut -d ':' -f2 | cut -d ';' -f1 | tr -d ' ')" = 'text/plain' ]
then
  curl -L 'https://big.oisd.nl/domainswild' > /etc/dnscrypt-proxy/blocklist.txt
fi

/etc/init.d/dnscrypt-proxy restart
/etc/init.d/dnscrypt-proxy_local restart
